import React from "react";
import { NavLink, useHistory } from "react-router-dom";
import "./style.css";

const Nav = () => {
  const histroy = useHistory();

  const goCity = () => {
    histroy.push("/city");
  };

  return (
    <nav>
      <span onClick={goCity}>杭州</span>
      <ul>
        <li>
          <NavLink to="/home/movies/hot">热映</NavLink>
        </li>
        <li>
          <NavLink to="/home/movies/cinema">影院</NavLink>
        </li>
        <li>
          <NavLink to="/home/movies/wait">待映</NavLink>
        </li>
        <li>
          <NavLink to="/home/movies/classic">经典电影</NavLink>
        </li>
      </ul>
    </nav>
  );
};

export default Nav;
